import request from '@/config/axios'

// 批号设置 VO
export interface BatchVO {
  id: number // 批次id
  fname: string // 前缀
  tname: string // 标识
  sname: number // 流水长度
}

// 批号设置 API
export const BatchApi = {
  // 查询批号设置分页
  getBatchPage: async (params: any) => {
    return await request.get({ url: `/wms/batch/page`, params })
  },

  // 查询批号设置详情
  getBatch: async (id: number) => {
    return await request.get({ url: `/wms/batch/get?id=` + id })
  },

  // 新增批号设置
  createBatch: async (data: BatchVO) => {
    return await request.post({ url: `/wms/batch/create`, data })
  },

  // 修改批号设置
  updateBatch: async (data: BatchVO) => {
    return await request.put({ url: `/wms/batch/update`, data })
  },

  // 删除批号设置
  deleteBatch: async (id: number) => {
    return await request.delete({ url: `/wms/batch/delete?id=` + id })
  },

  // 导出批号设置 Excel
  exportBatch: async (params) => {
    return await request.download({ url: `/wms/batch/export-excel`, params })
  },
}
